<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://localhost/juanpi/Static/Home/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="http://localhost/juanpi/Static/Home/js/js.js"></script>
<script type="text/javascript" src="http://localhost/juanpi/Static/Home/js/jquery.jqzoom.js"></script>
<script type="text/javascript" src="http://localhost/juanpi/Static/Home/js/base.js"></script>
<link rel="stylesheet" href="http://localhost/juanpi/Static/Home/css/content.css" />
<link rel="stylesheet" href="http://localhost/juanpi/Static/Home/css/base.css" />
<script src="http://localhost/juanpi/Static/Home/hdjs/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="http://localhost/juanpi/Static/Home/hdjs/hdjs.css"/>
<script type="text/javascript">
	$(function(){
		var num = 1;
		//商品数量
		$('.add').click(function(){
			num=num+1;
			$('#num').val(num);
		})
		$('.del').click(function(){
			if(num==1){
				return false;
			}
			num=num-1;
			$('#num').val(num);
		})
		
		
	})
</script>
<style type="text/css">
	.red{
		border: solid 1px #F36;
		background:#FF3366;
		color:#fff;
	}
</style>
<title>详细页</title>
</head>

<body>
<!-- 浏览器右侧开始 -->
<div id="scroll">
	<div class="man">
		<a href="<?php echo U('Member/index');?>"></a>
	</div>
	<div class="shop">
		<a href="<?php echo U('Shop/index');?>">
			<span class="num">
				    <?php if($_SESSION['cart']){ ?>
				<?php echo $hd['session']['cart']['total_rows'];?>
				<?php }else{ ?>0<?php } ?>
			</span>
		</a>
	</div>
	<div class="coll">
		<a href=""></a>
	</div>
	<div class="coup">
		<a href=""></a>
	</div>
	<div class="view">
		<a href=""></a>
	</div>
	<div class="code">
		<a href=""></a>
	</div>
	<div class="top">
		<a href=""></a>
	</div>
</div>
<!-- 浏览器右侧结束 -->	
	
<!--载入顶部-->
<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!-- 顶部开始 -->
<div id="toolbar">
	<!-- ****************登录/注册************** -->
	<div class="tool_r">
		    <?php if(isset($_SESSION['uid'])){ ?>
			<a href="<?php echo U('Member/index');?>"><?php echo $_SESSION['uname'];?></a><a href="<?php echo U('Index/out');?>">退出</a>
		<?php }else{ ?>
			<a href="<?php echo U('Login/index');?>">登录</a>
			<a href="<?php echo U('Register/index');?>">免费注册</a><span>|</span>
		<?php } ?>	
		<a href="<?php echo U('OrdCen/index');?>">我的订单</a>
		<a class="gouwu" href="<?php echo U('Shop/index');?>">
			<span class="gouwudai"></span>购物袋
			<span class="gouwuqiu">
				    <?php if($_SESSION['cart']){ ?>
				<?php echo $hd['session']['cart']['total_rows'];?>
				<?php }else{ ?>0<?php } ?>
			</span>
		</a><span>|</span>
		<a href="">联系客服</a>
	</div>
	<!-- ****************登录/注册************** -->
</div>
<!-- 顶部结束 -->


<!-- 头部开始 -->
<div id="header">
	<div id="top">
		<div class="logo">
			<a href="http://localhost/juanpi/index.php"></a>
		</div>
		<div class="center"></div>
		<div class="right">
			<form action="" method="">
				<input class="text" type="text" name="" id="" />
				<input class="tijiao" type="submit" value="" />
			</form>
		</div>
	</div>
	
</div>
<!-- logo结束 -->

<!-- 导航开始 -->
<div id="mainNav">
	<div class="nav">
		<ul>
			<li><a href="javascript:;">最新折扣</a></li>
			<?php
$data = K('Cate')->where("pid=0")->order('csort ASC')->limit('1000')->all();
foreach($data as $field):
$field['url'] = U('List/index',array('cid'=>$field['cid']));
?>

				<li><a href="<?php echo $field['url'];?>"><?php echo $field['cname'];?></a></li>
			
<?php endforeach ?>
		</ul>
	</div>
</div>
<!-- 导航结束 -->

<!--商品路径-->
<div id="tree">
	<?php foreach ($fatherCate as $k=>$v){?>
	<a href="<?php echo U('List/index',array('cid'=>$fatherCate[0]['cid']));?>"><?php echo $v['cname'];?></a> > 
	<?php }?>
	<a href=""><?php echo $goodsData['gname'];?></a>
</div>

<!--商品展示-->
<div id="show">
	<!--如果有图片-->
	    <?php if($DetData['good_pic']){ ?>
		<div class="show_l">
			<div id="preview" class="spec-preview">
				        <?php
        //初始化
        $hd['list']['v'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($DetData['good_pic'])) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($DetData['good_pic'] as $v) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=1)break;
                //第几个值
                $hd['list'][v]['index']++;
                //第1个值
                $hd['list'][v]['first']=($listId == 0);
                //最后一个值
                $hd['list'][v]['last']= (count($DetData['good_pic'])-1 <= $listId);
                //总数
                $hd['list'][v]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
					<span class="jqzoom"><img jqimg="http://localhost/juanpi/<?php echo $v['big'];?>" src="http://localhost/juanpi/<?php echo $v['mid'];?>" /></span>
				<?php }}?>
			</div>
			<!--缩图开始-->
			<div class="spec-scroll"> <a class="prev">&lt;</a> <a class="next">&gt;</a>
				<div class="items">
				    <ul>
				    	<?php foreach ($DetData['good_pic'] as $k=>$v){?>
				      		<li><img alt="佳能" bimg="http://localhost/juanpi/<?php echo $v['big'];?>" src="http://localhost/juanpi/<?php echo $v['mid'];?>" onmousemove="preview(this);"></li>
				      	<?php }?>
				    </ul>
				</div>
			</div>
		</div>
	<?php }else{ ?>
		<div class="show_l">
			<div id="preview" class="spec-preview">
					<h1 style="width:400px;height:400px;line-height:400px;font-size: 50px;text-align: center;">暂无图片</h1>
			</div>
		</div>
	<?php } ?>
	
	
	<form action="<?php echo U('Shop/index');?>" method="post">
	<div class="show_r">
		<div class="inf1"><?php echo $goodsData['gname'];?></div>
		<input type="hidden" name="gname" value="<?php echo $goodsData['gname'];?>"/>
		<div class="inf2">
			<span class="p1">￥</span>
			<span class="p2"><?php echo $goodsData['shopprice'];?></span>
			<span class="p3">1.7折 </span>
			<span class="p4">￥<?php echo $goodsData['marketprice'];?></span>
			 <span>购买可获得</span><span class="p5">170</span>
			 <span>积分</span> 
		</div>
		<div class="inf3">
			<span class="or1">满减</span>所有用户可享&nbsp;满<span class="or2">79</span>元减<span class="or2">5</span>元
		</div>
		<div class="inf4">运费：
    		<span>浙江省 &nbsp;</span><span>湖州市 &nbsp;</span>至 <span>北京﹀</span><span class="bao">包邮 </span>
		</div>
		<div class="inf31" id='inventory' style="height: 20px; line-height: 20px;"></div>
		
		<?php foreach ($tempSpec as $k=>$v){?>
		<div class="inf6">
			<!--颜色和尺码-->
			<span class="one"><?php echo $v['name'];?>：</span>
			<?php foreach ($v['value'] as $key=>$value){?>
				<span gtid="<?php echo $value['gtid'];?>" class="spec" specId="<?php echo $value['gtid'];?>" gname="<?php echo $value['gtvalue'];?>"><?php echo $value['gtvalue'];?></span>
			<?php }?>
		</div>
		<?php }?>
		<input type="hidden" name="specName" value=""/>
		<script type="text/javascript">
			$(function(){
				$('.spec').click(function(){
					$(this).addClass('red').siblings().removeClass('red');
					//选择的长度
					var len = $('.red').length;
					//li 的长度，就是有几种规格
					var liLen = $('.inf6').length;
					//选中2个以上才发送异步
					if(len>=liLen){
						var id = '';
						var gname = '';
						$.each($('.red'),function(){
							id += $(this).attr('specId') + ',';
							gname += $(this).attr('gname') + '&nbsp;';
						})
						$('input[name=specName]').val(gname);
						var gid = <?php echo $goodsData['gid'];?>;
						$.ajax({
							type:"post",
							url:"<?php echo U('Content/getAdd');?>",
							data:{id:id,gid:gid},
							dataType:'json',
							success:function(phpData){
								if(phpData['inventory']){
									$('.p2').html(phpData['specArr']);
									$('#inventory').html('<span>剩余库存：</span><span class="kucun">'+phpData['inventory']+'</span>');
									$('input[name=specid]').val(phpData['specArr']);
								}else{
									$('#inventory').html('<span>剩余库存：</span><span class="kucun">暂无库存</span>');
								}
							}
						});
					}
				})
				//如果暂无库存，则不能提交
				$('form').submit(function(){
					//如果没有库存则不能提交
					if($('.kucun').html()=='暂无库存'){
						return false;
					}
					//如果没有选择规格则不能提交
					var len = $('.red').length;
					//li 的长度，就是有几种规格
					var liLen = $('.inf6').length;
					//选中2个以上才能提交
					if(len<liLen){
						$('.messeg').html('请选择规格！');
						return false;
					}
				})
			})
		</script>
		
		<div class="inf7">
			<span class="one">数量：</span><span class="del">-</span><input type="text" name="num" id="num" value="1" /><span class="add">+</span>
		</div>
		<b class="messeg" style="color: #F36;">&nbsp;</b>
		<input type="hidden" name="gid" value="<?php echo $goodsData['gid'];?>"/>
		<input type="hidden" name="specid" value="<?php echo $goodsData['shopprice'];?>"/>
		<div class="inf8"><input type="submit" value="加入购物袋"/></div>
	</div>
	</form>
</div>

<!--店铺承诺-->
<div id="dianpu">
		<a href="">班澜贝屋旗舰店</a>
</div>
<!--tab切换-->
<div id="tab">
	<a class="one" href="">商品详情</a>
	<a href="">物流与售后</a>
	<a href="">消费保障</a>
</div>

<div id="mao_link">
	<a href="">整体款式</a>
	<a href="">细节做工</a>
	<a href="">模特实拍</a>
</div>

<!--商品信息列表-->
<div id="info_list">
	<div class="tit">参数规格</div>
	<table>
		<?php foreach ($tempSpec as $k=>$v){?>
			<tr>
				<td><?php echo $v['name'];?>：</td>
				<td>
					<?php foreach ($v['value'] as $key=>$value){?><?php echo $value['gtvalue'];?>&nbsp;&nbsp;<?php }?>
				</td>
			</tr>
		<?php }?>
	</table>
	<div class="tit">整体款式</div>
	<div class="img" style="text-align: center;">
		<?php echo $DetData['intro'];?>
	</div>
	<div class="tit">物流与售后</div>
	<div class="shouhou" style="text-align: center;">
		    <?php if($DetData['service']){ ?>
			<?php echo $DetData['service'];?>
			<?php }else{ ?>
			<span>发货物流：</span>EMS，韵达快运，天天快递<br />
			<span>配送范围：</span>全国（港澳台地区除外）。<br />
			<span>运费说明：</span>西藏自治区、新疆维吾尔自治区、内蒙古自治区、宁夏回族自治区、甘肃省、青海省需收邮费5.00元/件；全国其他大陆地区均包邮。<br />
			<span>包裹跟踪：</span>您可在<a href="">【我的订单】</a>中查询物流跟踪信息。<br />
			<span>确认收货：</span>当快件送达至您的收货地址后，卷皮将为您自动确认收货并将奖励积分发放至您的账户。<br />
			<img src="http://localhost/juanpi/Static/Home/images/renturn-process.jpg"/><br />
			<span>售后服务承诺</span><br />
			收到货后，如果因为主观原因不喜欢\不想要了，在不影响二次销售的情况下，签收后7天内，卷皮网为你提供七天无理由退货服务。如果您未收到货或收到商品有质量问题，可以在签收后15天内可申请售后。 <a href="">售后服务说明>></a><br />
			<span>运费补贴政策</span><br />
			当您的退货商品单价≥30元，卷皮将补贴你10元优惠劵至您的卷皮账户中作为运费补贴。（每个订单仅补贴一次优惠劵） <a href="">退货运费补贴说明>></a>
		<?php } ?>
		
	</div>
</div>

<!--黑线-->
<div id="black_len">
	<div class="font">HOT同类热卖</div>
</div>

<!-- 商品列表开始 -->
<div id="goodsList">
	<ul>
		        <?php
        //初始化
        $hd['list']['v'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($Clothes)) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($Clothes as $v) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=5)break;
                //第几个值
                $hd['list'][v]['index']++;
                //第1个值
                $hd['list'][v]['first']=($listId == 0);
                //最后一个值
                $hd['list'][v]['last']= (count($Clothes)-1 <= $listId);
                //总数
                $hd['list'][v]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
			<li>
				<div class="new"></div>
				<a href="<?php echo U('index',array('gid'=>$v['gid']));?>">
					<img width="230" src="http://localhost/juanpi/<?php echo $v['img'];?>" alt="" />
				</a>
			</li>
		<?php }}?>
		
	</ul>
</div>
<!-- 商品列表结束 -->

<div id="hr"></div>

<!-- 底部开始 -->
<div id="bottom">
	<div class="bo_l">
		<img src="http://localhost/juanpi/Static/Home/images/jp-app-90.png" alt="" /><br />
		扫描二维码下载
	</div>
	<div class="bo_c">
		<ul>
     		<p>获取更新</p>
			<li>●&nbsp;<a href="">iPhone/Android</a></li>
			<li>●&nbsp;<a href="">卷皮QQ空间</a></li>
			<li>●&nbsp;<a href="">卷皮新浪微博</a></li>
			<li>●&nbsp;<a href="">开放API</a></li>
		</ul>
		<ul>
     		<p>商务合作</p>
			<li>●&nbsp;<a href="">卖家免费报名</a></li>
			<li>●&nbsp;<a href="">商务合作</a></li>
			<li>●&nbsp;<a href="">廉政邮箱</a></li>
			<li>●&nbsp;<a href="">lianzheng@juanpi.com</a></li>
		</ul>
		<ul>
     		<p>公司信息</p>
			<li>●&nbsp;<a href="">关于卷皮</a></li>
			<li>●&nbsp;<a href="">媒体报道</a></li>
			<li>●&nbsp;<a href="">诚聘英才</a></li>
			<li>●&nbsp;<a href="">校园大使招募</a></li>
		</ul>
		<ul>
     		<p>帮助中心</p>
			<li>●&nbsp;<a href="">新手上路</a></li>
			<li>●&nbsp;<a href="">积分攻略</a></li>
			<li>●&nbsp;<a href="">网站地图</a></li>
		</ul>
	</div>
	<div class="bo_r">
		<a href=""></a>
		<span>周一至周日<br />9:00-22:00</span>
	</div>
</div>
<!-- 友情链接 -->
<div id="flink">
	 友情链接：
    <a href="">国画</a>
    <a href="">齐家装修</a>
    <a href="">大朴网</a>
    <a href="">世界名表</a>
    <a href="">葡萄酒</a>
    <a href="">易登网</a>
    <a href="">普洱茶</a>
    <a href="">中关村商城</a>
    <a href="">品牌鞋</a>
    <a href="">乐蜂网优惠券</a>
    <a href="">精选折扣</a>
    <a href="">拍鞋网官网</a>
	<a class="more" href="">更多>></a>
</div>


<div id="copy">
	武汉奇米网络科技有限公司 鄂ICP备10209250号　　Copyright © 2010 -2015 JuanPi.com All Rights Reserved
</div>

<div id="safe">
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_315online.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_cnnic.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/r_gongshang.gif" alt="" /></a>
	<a href=""><img src="http://localhost/juanpi/Static/Home/images/sm_124x47.png" alt="" /></a>
</div>
<!-- 底部结束 -->
</body>
</html>
